<?php
/**
 * "Visual Paradigm: DO NOT MODIFY THIS FILE!"
 * 
 * This is an automatic generated file. It will be regenerated every time 
 * you generate persistence class.
 * 
 * Modifying its content may cause the program not work, or your work may lost.
 */

/**
 * Licensee: DuKe TeAm
 * License Type: Purchased
 */

class Categories extends Doctrine_Record {
  public function setTableDefinition() {
    $this->setTableName('categories');
    $this->hasColumn('cat_id', 'integer', 4, array(
        'type' => 'integer',
        'length' => 4,
        'unsigned' => false,
        'notnull' => true,
        'primary' => true, 
        'autoincrement' => true,
      )
    );
    $this->hasColumn('cat_name', 'string', 255, array(
        'type' => 'string',
        'length' => 255,
        'fixed' => false,
        'notnull' => false,
      )
    );
    $this->hasColumn('cat_image', 'string', 255, array(
        'type' => 'string',
        'length' => 255,
        'fixed' => false,
        'notnull' => false,
      )
    );
    $this->hasColumn('cat_position', 'integer', 4, array(
        'type' => 'integer',
        'length' => 4,
        'unsigned' => false,
        'notnull' => false,
      )
    );
    $this->hasColumn('cat_type', 'integer', 4, array(
        'type' => 'integer',
        'length' => 4,
        'unsigned' => false,
        'notnull' => false,
      )
    );
    $this->hasColumn('cat_status', 'integer', 4, array(
        'type' => 'integer',
        'length' => 4,
        'unsigned' => false,
        'notnull' => false,
      )
    );
    $this->hasColumn('cat_createtime', 'timestamp', 0, array(
        'type' => 'timestamp',
        'length' => 0,
        'notnull' => false,
      )
    );
    $this->hasColumn('cat_updatetime', 'timestamp', 0, array(
        'type' => 'timestamp',
        'length' => 0,
        'notnull' => false,
      )
    );
    $this->hasColumn('page_view_id', 'integer', 4, array(
        'type' => 'integer',
        'length' => 4,
        'unsigned' => false,
        'notnull' => true,
      )
    );
    $this->hasColumn('categories_id', 'integer', 4, array(
        'type' => 'integer',
        'length' => 4,
        'unsigned' => false,
        'notnull' => false,
      )
    );
  }
  
  public function setUp() {
    parent::setUp();
    $this->hasOne('Page_views as page_view', array(
        'local' => 'page_view_id', 
        'foreign' => 'pview_id'
      )
    );
    $this->hasOne('Categories as categories', array(
        'local' => 'categories_id', 
        'foreign' => 'cat_id'
      )
    );
    $this->hasMany('Categories as categories1', array(
        'local' => 'cat_id', 
        'foreign' => 'categories_id'
      )
    );
    $this->hasMany('Articles as articles', array(
        'local' => 'cat_id', 
        'foreign' => 'categoriescat_id'
      )
    );
    $this->hasMany('Page_views_categories as page_views_categories', array(
        'local' => 'cat_id', 
        'foreign' => 'cat_id'
      )
    );
  }
  
}

?>
